pascal void SetTrackGWorld(Track theTrack, CGrafPtr port, GDHandle gdh, TrackTransferProc proc, long refCon)
theTrack The track to set the proc to.
port The port for the track to draw to, or nil to use the movie's GWorld.
gdh GDevice associated with the port, or nil.
proc Returns pointer to your transfer procedure, or nil to remove it.
refCon Value to pass to your transfer procedure.
typedef pascal OSErr (*TrackTransferProc)(Track t, long refCon);
Errors:
invalidTrack -2009 Your track reference is bad.
typedef struct { GWorldPtr gw; GWorldPtr efxTrack; GWorldPtr tween; short trackStat; Rect dst; WindowPtr wp; } mSpfx; typedef struct { Movie mv; MovieController mctl; Rect mrect; mSpfx *mefx; GWorldPtr backPict; } mvInfo, *mvPtr; /* these are the track transfer procedures, all they do is set a flag to */ /* indicate to the drawing completion proc that both tracks are ready */ pascal OSErr FrontTrackTransferProc(Track t, mSpfx *mfx) { mfx->trackStat |= 1; // first bit for the front, or main track return noErr; } pascal OSErr EfxTrackTransferProc(Track t, mSpfx *mfx) { mfx->trackStat |= 2; // second bit for the special effects track return noErr; } pascal OSErr MovieDrawingProc(Movie m, mvPtr mvp) {} void SetUpMovieEffect(Movie m, WindowPtr wp) { Track t; mSpfx *mfx; OSErr err;
Rect bounds; mvPtr mvi; long numTracks; /* set up the transfer procedures for each track */ /* track 1 is the main movie track */ /* track 2 is the special effects track */ t = GetMovieIndTrack(m,1); SetTrackGWorld(t, mfx->gw, nil, (TrackTransferProc)FrontTrackTransferProc, (long) mfx); t = GetMovieIndTrack(m,2); SetTrackGWorld(t, mfx->efxTrack, nil, (TrackTransferProc)EfxTrackTransferProc, (long) mf /* set up the routine that actually does the drawing */ /* this routine is called after the movie toolbox draws all the tracks */ /* into the offscreen GWorlds set up above */ SetMovieDrawingCompleteProc(m, (MovieDrawingCompleteProcPtr)MovieDrawingProc, (long) mvi); GoToBeginningOfMovie(m); }
Main | Page One | What's New | Apple Computer, Inc. | Find It | Contact Us | Help